/**
 * @Author：ming
 * @Date：2023/10/2 9:39 PM
 * @Filename：Hj8
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;

/**
 * @author ming
 */
public class Hj23 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str ;
        while ((str=br.readLine())!=null){
            String s = deleteLess(str);
            System.out.println(s);
        }
    }

    public static String deleteLess(String s){
        char[] c = s.toCharArray();
        HashMap<Character, Integer> map = new HashMap<>();
        for (int i = 0; i < c.length; i++) {
            char temp = c[i];
            if(map.containsKey(temp)){
                map.put(temp,map.get(temp)+1);
            }else {
                map.put(temp,1);
            }
        }

        ArrayList<Character> list = new ArrayList<>(map.keySet());

        Collections.sort(list, new Comparator<Character>() {
            @Override
            public int compare(Character o1, Character o2) {
                return map.get(o1)-map.get(o2);
            }
        });

        Character less = list.get(0);
        s=s.replaceAll(less.toString(),"");
        for (Character temp : list) {
            if(map.get(temp)==map.get(less)){
                s=s.replaceAll(temp.toString(),"");
            }
        }
        return s;
    }
}
